function getPmo(){
	$.ajax({
		url : 'http://pmo/list',
		dataType : 'json',
		success : function(data){
			var pmoList = data.list || [];
			var html='';
			for(var i=0; i<pmoList.length; i++){
				if(i==0){
					html+='<div class="pmo-item" id="pmo-admin '+pmoList[i].pmoid+'">';
				}else{
					html+='<div class="pmo-item" id="'+pmoList[i].pmoid+'">';
				}
				html+='<a class="pmo-del"></a>';
				html+='<h3>'+pmoList[i].name+'</h3>';
				html+='<p class="pmo-user">';
				html+='<span class="pmo-userImg"><img src="'+pmoList[i].userimg[i]+'" alt="用户头像"/></span>';
				if(i==0){
					html+='<span><input name="owner" type="checkbox" checked="checked"/><label>Admin</label></span>';
				}
				html+='</p>';
				html+='<p class="pmo-usermsg-group">';
				html+='<span>'+pmoList[i].titler+'</span>';
				html+='<span>'+pmoList[i].company[i]+'</span>';
				html+='</p>';
				html+='<p>'+pmoList[i].addr[i]+'</p>';
				html+='<p class="pmo-usermsg-group">';
				html+='<span>+86 '+pmoList[i].mobile+'</span>';
				html+='<span>'+pmoList[i].email+'</span>';
				html+='</p>';
				html+='<p class="pmo-usermsg-group">';
				html+='<span>Experience:</span>';
				html+='<span class="pmo-useExp">'+pmoList[i].exper+'</span>';
				html+='</p>';
				html+='<a class="pmo-currentPro-btn">Current Projects</a>';
				html+='</div>';
			}
			$(".pmo-list").append(html);
			pmoListTab();
			pmoClick();
			CurrentClick();
			/**/
			
		}
	})
}

getPmo();
function currentProject(){
	$.ajax({
		url : 'http://projects/list',
		dataType : 'json',
		success : function(data){
			var html = "";
			html = html + '<div class="pmo-currentPro common-table" id="currentBox">';
			html = html + '<table><thead><tr>';
			html = html + '<th class="col-1">Project01 Name</th>';
			html = html + '<th class="col-2">Client Name</th>';
			html = html + '<th class="col-2">Start Date</th>';
			html = html + '<th class="col-2">End Date</th>';
			html = html + '</tr></thead>';
			html = html + '<tbody>';
			var projectList = data.list || [];
			for(var i=0; i<1; i++){
				html = html + '<tr id="'+projectList[i].projectId+'">';
				html = html + '<td class="col-1">'+projectList[i].projectName+'</td>';
				html = html + '<td class="col-2">'+projectList[i].clientName[i]+'</td>';
				html = html + '<td class="col-2">'+projectList[i].projectStartDate+'</td>';
				html = html + '<td class="col-2">'+projectList[i].projectEndDate+'</td>';
				html = html + '</tr>';
			}
			html = html + '</tbody>';
			html = html + '</table>';
			html = html + '<a class="pmo-completedPro-btn">Completed</a>';
			html = html + '</div>';
			$(".projectTable").append(html);
			completedClick();
			$("body").animate({scrollTop: $("#currentBox").offset().top}, 1000); 
		}
	})
}

function completedProject(){
	$.ajax({
		url : 'http://projects/list',
		dataType : 'json',
		success : function(data){
			var html = "";
			html = html + '<div class="pmo-completedPro common-table" id="compBox">';
			html = html + '<table><thead><tr>';
			html = html + '<th class="col-1">Project0 Name</th>';
			html = html + '<th class="col-2">Client Name</th>';
			html = html + '<th class="col-2">Start Date</th>';
			html = html + '<th class="col-2">End Date</th>';
			html = html + '</tr></thead>';
			html = html + '<tbody>';
			var projectList = data.list || [];
			for(var i=0; i<data.list.length; i++){
				html = html + '<tr id="'+projectList[i].projectId+'">';
				html = html + '<td class="col-1">'+projectList[i].projectName+'</td>';
				html = html + '<td class="col-2">'+projectList[i].clientName[i]+'</td>';
				html = html + '<td class="col-2">'+projectList[i].projectStartDate+'</td>';
				html = html + '<td class="col-2">'+projectList[i].projectEndDate+'</td>';
				html = html + '</tr>';
			}
			html = html + '</tbody>';
			html = html + '</table>';
			html = html + '</div>';
			$(".projectTable").append(html);
			$("body").animate({scrollTop: $("#compBox").offset().top}, 1000); 
		}
	})
}